﻿using JetBrains.Annotations;
using Volo.Abp;

namespace System.ComponentModel.DataAnnotations;

/// <summary>
/// Marks a class, property or field with a comment which will be included in the SQL sent to the database .
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Property)]
public sealed class CommentAttribute : Attribute
{
    /// <summary>
    /// The Comment
    /// </summary>
    public string Comment
    {
        get;
    }

    /// <summary>
    /// Initializes a new instance of the Microsoft.EntityFrameworkCore.CommentAttribute class.
    /// </summary>
    /// <param name="comment">The comment.</param>
    public CommentAttribute([NotNull] string comment)
    {
        Check.NotNullOrEmpty(comment, nameof(comment));
        Comment = comment;
    }
}

